package Kuaishou;

import java.util.List;

import com.google.common.collect.Lists;

/**
 * @author leiwenkang <leiwenkang@kuaishou.com>
 * Created on 2020-12-15
 */
public class Test14异步执行 {
    public static void main(String[] args) {
        List<Integer> list = Lists.newArrayList();
        for (int i = 0; i < 10; i++) {
            list.add(i);
        }
        list.parallelStream().forEach(num -> {
            System.out.print(num);
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        System.out.println("aaaaaaaaaaaa");
    }
}
